using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Drawing;

[assembly: CLSCompliant(false)]
namespace qPrintComponent
{
    [ToolboxBitmap(typeof(PrintDialog))]
    public partial class PrintComponent : Component
    {
        internal static qSafePrinterHandle SafePrinterHandle = new qSafePrinterHandle();
        
        public PrintComponent()
        {
            InitializeComponent();
        }

        public PrintComponent(IContainer container)
        {
            container.Add(this);
            InitializeComponent();
            
        }
        [Description("The name of the printer"), TypeConverter(typeof(PrinterNameConverter)), ReadOnly(false)]        
        public string printername
        {
            get 
            {
                return SafePrinterHandle.PrinterName;
            }
            set
            {
                if (SafePrinterHandle.PrinterName != value)
                    SafePrinterHandle.PrinterName = value;
            }
        }
        [TypeConverter(typeof(ExpandableObjectConverter)), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),Browsable(false)]
        public qSafePrinterHandle Information
        {
            get
            {
                return PrintComponent.SafePrinterHandle;
            }
        }
    }
}
